﻿using BCEntity.TMS.MarketingCoupon.MarketingCoupon;
using BCEntity.TMS.MarketingCoupon.MarketingCouponType;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BCData.TMS.MarketingCoupon.MarketingCouponType
{
    public interface IMarketingCouponTypeData
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity">优惠券</param>
        /// <returns></returns>
        Task<MarketingCouponTypeEntity> InsertAsync(MarketingCouponTypeEntity entity);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity">优惠券</param>
        /// <returns></returns>
        Task<MarketingCouponTypeEntity> UpdateAsync(MarketingCouponTypeEntity entity);
        /// <summary>
        /// 获取信息
        /// </summary>
        /// <param name="marketingCouponTypeId">优惠券类型Id</param>
        /// <returns></returns>
        Task<MarketingCouponTypeEntity> GetSingle(long marketingCouponTypeId);

        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="isValid">是否有效</param>
        /// <param name="isEnabled">是否启用</param>
        /// <param name="couponMinAmount">优惠最小金额</param>
        /// <param name="couponMaxAmount">优惠最大金额</param>
        /// <returns></returns>
        Task<IEnumerable<MarketingCouponTypeEntity>> GetList(long agentRecordId, bool? isEnabled,bool? isValid, decimal? couponMinAmount, decimal? couponMaxAmount);
        /// <summary>
        /// 获取分页
        /// </summary>
        /// <param name="isEnabled">是否启用</param>
        /// <param name="couponMinAmount">优惠最小金额</param>
        /// <param name="couponMaxAmount">优惠最大金额</param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(IEnumerable<MarketingCouponTypeEntity>, int)> Query(bool? isEnabled, decimal? couponMinAmount, decimal? couponMaxAmount,
            int pageIndex, int pageSize);
        /// <summary>
        /// 获取优惠券总数量
        /// </summary>
        /// <returns></returns>
        Task<MarketingCouponCountEntity> GetAllCount(long? agentRecordId);
        /// <summary>
        /// 获取用户端可以领取的地区
        /// </summary>
        /// <param name="agentRecordId">代理商id</param>
        /// <param name="countyCode">区编码</param>
        /// <returns></returns>
        Task<IEnumerable<MarketingCouponTypeEntity>> GetCanReceiveList(long agentRecordId,string countyCode);

        /// <summary>
        /// 领取
        /// </summary>
        /// <param name="marketingCouponTypeId">优惠券类型Id</param>
        /// <returns></returns>
        Task<MarketingCouponTypeEntity> Receive(long marketingCouponTypeId);
    }
}
